<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui">

    <ui:composition template="/template/DefaultTemplate.xhtml">
        <ui:define name="title">
            <h:outputText value="Create Price List"></h:outputText>
        </ui:define>
        <ui:define name="content">
            <h:form rendered="#{loginBacking.addPriceList}">
                <p:panel header="Create Price List">
                    <p:messages />
                    <br />
                    <h:panelGrid columns="2">
                        <h:outputLabel value="Type:" for="type" />
                        <h:selectOneMenu id="type" value="#{priceListEntityController.selected.type}">
                            <f:selectItems value="#{priceListEntityController.customerType}"/>
                        </h:selectOneMenu>
                        <h:outputLabel value="Product:" for="product" />
                        <h:selectOneMenu id="product" value="#{priceListEntityController.selected.product}">
                            <f:selectItems value="#{completedGoodsEntityController.itemsAvailableSelectOne}"/>
                        </h:selectOneMenu>
                        <h:outputLabel value="Tiered Quantity:" for="quantity" />
                        <h:inputText id="quantity" value="#{priceListEntityController.selected.tieredQuantity}"/>
                        <h:outputLabel value="Price:" for="price" />
                        <h:inputText id="price" value="#{priceListEntityController.selected.price}"/>
                    </h:panelGrid>
                    <br />
                    <p:commandButton ajax="false" action="#{priceListEntityController.create}" value="Save" />
                    &nbsp;
                    <p:commandButton ajax="false" action="#{priceListEntityController.prepareList}" value="Show All" immediate="true"/>
                    <br />
                    <br />
                </p:panel>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
